Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added properties disableFindAndReplace,disableCheckBox and disa… #908

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

thisismayuresh
Copy link
Collaborator

@thisismayuresh thisismayuresh commented Dec 24, 2024

Enhanced Table Component with Conditional Disable Features

This update introduces additional flexibility to the table component by allowing users to conditionally disable certain features using the config prop. With this new feature, specific functionalities like Find and Replace, Checkbox, and Serial Number (SrNo) can be easily enabled or disabled based on the value passed in the config object.

New config Prop

users can conditionally disable specific features. they can pass the config prop with the following keys:

  • disableFindAndReplace: Disables the Find and Replace functionality.
  • disableCheckBox: Disables the Checkbox functionality (for row selection).
  • disableSrNo: Disables the Serial Number (SrNo) column.
  • If a feature is not passed or if its value is set to false, the corresponding feature will remain enabled.

Example Usage

const { showWidget, isImplerInitiated } = useImpler({
  templateId: templateData?._id,
  projectId: templateData?._projectId,
  accessToken: profileInfo?.accessToken,
  config: {
    disableFindAndReplace: true,
    disableCheckBox: true, 
    disableSrNo: true
  }
});

In this example:

  • Find and Replace is disabled (disableFindAndReplace: true).
  • Checkbox functionality is disabled (disableCheckBox: true).
  • Serial Number column is disabled (disableSrNo: true).

Default Behaviour

If the config prop is not passed or if any key is missing from the congig object, the corresponding feature will remain enabled by default.

For example, if you only pass disableCheckBox: true but omit the other options, the Find and Replace and Serial Number features will remain enabled, while the checkbox feature will be disabled.

Benefits

Customizability: Users can now easily toggle which features are enabled or disabled based on project requirements.
Simplified Configuration: By using the config object, you can manage multiple feature settings in a single configuration.
Flexibility: This new feature provides the flexibility to disable or enable specific features without needing to modify the core table logic.

Notes

  • The config prop is optional. If not provided, all features will remain enabled by default.
  • If you wish to disable specific features, simply pass true for the corresponding keys in the config object.
  • Missing or false values for the config keys will ensure the features remain enabled.

Copy link

nx-cloud bot commented Dec 24, 2024

View your CI Pipeline Execution ↗ for commit c0f04ed.

Command Status Duration Result
nx run-many --target=build --all ✅ Succeeded 2m 10s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-03 05:32:04 UTC

apps/widget/src/hooks/Phase3/usePhase3.tsx Outdated Show resolved Hide resolved
apps/widget/src/hooks/Phase3/usePhase3.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants